<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./lib/vue-2.5.9.js"></script>
  <script src="./lib/vue-router-v3.0.1.js"></script>
</head>

<body>
  <div id="app">
    <router-view></router-view>
    <router-view></router-view>
  </div>

  <script>

    const sidebar = {
      template: `<h1>左侧侧边栏</h1>`
    }
    const content = {
      template: `<h1>右侧内容区域</h1>`
    }

    const router = new VueRouter({
      routes: [
        // 之前的路由规则，当匹配到一个路由的时候，只能在页面的容器中，放置唯一的一个组件
        { path: '/', component: sidebar }, 
        { path: '/', component: content }
      ]
    })

    // 创建 Vue 实例，得到 ViewModel
    var vm = new Vue({
      el: '#app',
      data: {},
      methods: {},
      router
    });
  </script>
</body>

</html>